<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
    var t = async_test('Makes sure that unsupported stylesheet types are neither preloaded nor loaded');
    var cssLoaded = false;
    var jsLoaded = false;
    var noTypeLoaded = false;
</script>
<script src="../resources/slow-script.pl?delay=500"></script>
<link rel=stylesheet href="../resources/dummy.css?1" type="text/css" onload="cssLoaded = true;">
<link rel=stylesheet href="../resources/dummy.css?2" type="application/javascript" onload="jsLoaded = true;">
<link rel=stylesheet href="../resources/dummy.css?3" onload="noTypeLoaded = true;">
<script>
    window.addEventListener("load", t.step_func(function() {
        var entries = performance.getEntriesByType("resource");
        for (var i = 0; i < entries.length; ++i) {
            console.log(entries[i].name);
        }
        assert_equals(entries.length, 5);
        assert_true(cssLoaded, "text/css triggered load event");
        assert_false(jsLoaded, "application/javascript triggered load event");
        assert_true(noTypeLoaded, "no type triggered load event");
        t.done();
    }));
</script>

